package com.atguigu.gulimall.common.exception;

import lombok.Getter;

/**
 * @author majinhui
 * @description
 * @create 2024/7/20 23:48
 **/
public enum BizCodeEnum {
    UNKNOWN_EXCEPTION(10000,"系统未知异常"),
    VALID_EXCEPTION(10001,"参数格式校验失败"),
    SMS_CODE_EXCEPTION(10002,"验证码获取频率太高，稍后再试"),
    PRODUCT_UP_EXCEPTION(11000,"商品上架异常"),
    USER_EXIST_EXCEPTION(15001,"用户名已存在"),
    USER_PASSWORD_EXCEPTION(15002,"密码错误"),
    USER_NOT_EXIST_EXCEPTION(15003,"用户不存在"),


    ;

    @Getter
    private int code;
    @Getter
    private String msg;

    BizCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getMessage(){
        return msg;
    }
}
